-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keras -> SNN IPython notebook #141
Conversation
I would put the pre-trained weights on Google Drive. |
acbb430
to
966cb86
Compare
7cc125d
to
0a5cfc8
Compare
looks really good! a couple of smaller comments, in the conversion to spikes block there's non-zero outpt from the second layer. My understanding is this in from a bias term added to the final output, i think it'd be worth mentioning
In the synaptic smoothing block: mentioning that the synapse is averaging over a short time (not necessary for those familiar with low pass filters but just a bit more explicit for others)
In the firing rates block, the line about the true firing rate of the neuron I found confusing, attempted a rewrite
And in the regularization during training block, I think it's worth mentioning that adding the term during training works is also what you want to do when using nonlinear activation functions
|
a9aa2c1
to
7d0c2f7
Compare
Yeah those are all good clarifications, made the changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I made a few changes. The first commit makes a few minor wording changes, and also decreases the batch size during testing to 20. I first started looking at batch size here because the synapse runs (with n_steps = 150
) were giving me OOM errors, and my GPU is not small (6 GB), so I wanted to decrease it to make sure we work across a variety of GPUs. Then I realized that it actually runs considerably faster for me with a smaller batch size. 20 seemed like a good balance.
The second commit adds a line that shows the "output density" (number of non-zero timesteps) to run_network
. The idea behind this is it's nice to have some sort of quantitative measure of the firing rate, particularly when we get into changing the rate scaling. However, we can't just take the mean output, because rate scaling uses the neuron amplitude to counteract the increase in firing rate, so the output stays the same. So output density seemed like a better metric. I think it makes the discussion around firing rates a bit clearer (particularly when we say things like "increasing the scaling too high makes the network like a rate network again"), but I'm open to suggestions.
Looks good! I thought that the notion of "output density" might be a bit too abstract for people, so I changed it to just directly report firing rates. I also added it directly to the title of the neural activities plot, so that the connection between that graph and the reported numbers was clear. |
b508cb2
to
9c2e95d
Compare
One more thought: Maybe in the section that does firing rate scaling, we should mention that this only works for ReLUs, because they're scale invariant, and not for LIFs. This would also be a nice segue into the regularization section, where we can basically say "here's a method that can work with any neuron type, including LIFs". |
that was the original flow, i think that it was removed because we then didn't show any training with LIFs? |
a108a0d
to
6f74b37
Compare
Is there a reason not to have the regularization section use LIFs? |
I looked at it briefly, but it changes some other things as well (e.g. the neural activities look a bit different, the shape of the output predictions gets sharper thanks to the LIF nonlinearity). So you have to discuss that a bit (to make it clear that this is a result of the different neuron type, not the regularization). And the accuracy isn't as good, so then you have to tweak some things for that. So I thought that all ended up just being distracting from the main point we wanted to make (that you can use a regularization function to control the firing rates). |
6f74b37
to
e5e7d1c
Compare
Co-authored-by: Daniel Rasmussen <[email protected]>
e5e7d1c
to
cb235d6
Compare
so i find it super useful to limit memory allocation
otherwise i find i have to shut down the notebook before i can run any other models. what are the thoughts on this? |
You can set that when you start up the notebook like
In general, I think those kind of environmental configuration things should be left up to the user, rather than set in our examples. I suspect 90% of users will just be looking at the rendered examples online, not running it themselves, so it'd just add clutter for them. |
Have an initial draft up, looking for feedback. Right now it's a fair bit longer than other examples.
test_images_30
andtest_images_100
, but I didn't come up with a much better way to do generate and pass around two data that is presented for two different lengths of time. It'd be nice to make sure the user can run things out of order after the first few cells.run_network
function because they're not used anywhere else.